$(function() {
	$(window).resize(function(){
		bgsize();loginlocation();logolocation();
		});
	$(window).load(function(){
		bgsize();loginlocation();logolocation();
		});
});

function bgsize() {
	var bg_width;
	var bg_height;
	bg_height = window.innerHeight;
	bg_width = bg_height * 4 / 3;
	$("#bg").attr("width",bg_width);
	$("#bg").attr("height",bg_height);	
}

function loginlocation() {
	var win_width;
	var win_height;
	var bg_width;
	var bg_height;
	var login_width;
	var login_height;
	var thisTop;
	var thisLeft;
	win_width = window.innerWidth;
	win_height = window.innerHeight;
	bg_width = $("#bg").width();
	bg_height = $("#bg").height();
	login_width = $("#login_div").width();
	login_height = $("#login_div").height();
	thisTop = (bg_height - login_height) *5 /20;
	thisLeft = (win_width / 2) + (bg_width * 7 / 16) - login_width;
	$("#login_div").css("top", thisTop);
	$("#login_div").css("left", thisLeft);
}

function logolocation() {
	var win_width;
	var bg_width;
	win_width = window.innerWidth;
	bg_width = $("#bg").width();
	var thisLeft;
	thisLeft = (win_width - bg_width + 40) / 2;
	$("#logo_div").css("left",thisLeft);
}